import React, { Component } from 'react';
import '../styles/Register.scss'
import pic from '../assets/login.jpg'
import { Form, Input, Button} from 'antd-mobile'
import { withRouter } from 'react-router-dom';
class Register extends Component {

    Register(){
        this.props.history.push('/login')
    }
    render() {
        return (
            <div className='register'>
                <div className="toppic">
                    <img src={pic} alt="" />
                </div>
                <div className="forms">
                    {/* <input type="text"placeholder='请输入手机号' /> */}
                    {/* <input type="password" placeholder='请输入密码' /> */}


                    <Form
                        ref='formRef'
                        footer={
                            <Button block type='submit' color='primary' size='large'>
                                注册
                            </Button>
                        }
                    >
                        <Form.Item name='phone' rules={[{ required: true, message: '手机号不能为空' }]}>
                            <Input type='text' placeholder='请输入手机号' />
                        </Form.Item>
                        <Form.Item name='pass' rules={[{ required: true, message: '密码不能为空' }]}>
                            <Input type='password' placeholder='请输入密码' />
                        </Form.Item>
                        <Form.Item name='pass' rules={[{ required: true, message: '密码不能为空' }]}>
                            <Input type='password' placeholder='请再次确认密码' />
                        </Form.Item>



                    </Form>

                </div>
                <div className="bottons">
                    <div className="text">
                        <p onClick={()=>{this.Register()}}>已有账号，去登录</p>
                    </div>
                </div>
            </div>
        );
    }
}

export default withRouter(Register);